# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Content.V2.Model.TestOrderLineItemProduct do
  @moduledoc """


  ## Attributes

  *   `brand` (*type:* `String.t`, *default:* `nil`) - Required. Brand of the item.
  *   `channel` (*type:* `String.t`, *default:* `nil`) - Deprecated. Acceptable values are: - "`online`" 
  *   `condition` (*type:* `String.t`, *default:* `nil`) - Required. Condition or state of the item. Acceptable values are: - "`new`" 
  *   `contentLanguage` (*type:* `String.t`, *default:* `nil`) - Required. The two-letter ISO 639-1 language code for the item. Acceptable values are: - "`en`" - "`fr`" 
  *   `fees` (*type:* `list(GoogleApi.Content.V2.Model.OrderLineItemProductFee.t)`, *default:* `nil`) - Fees for the item. Optional.
  *   `gtin` (*type:* `String.t`, *default:* `nil`) - Global Trade Item Number (GTIN) of the item. Optional.
  *   `imageLink` (*type:* `String.t`, *default:* `nil`) - Required. URL of an image of the item.
  *   `itemGroupId` (*type:* `String.t`, *default:* `nil`) - Shared identifier for all variants of the same product. Optional.
  *   `mpn` (*type:* `String.t`, *default:* `nil`) - Manufacturer Part Number (MPN) of the item. Optional.
  *   `offerId` (*type:* `String.t`, *default:* `nil`) - Required. An identifier of the item.
  *   `price` (*type:* `GoogleApi.Content.V2.Model.Price.t`, *default:* `nil`) - Required. The price for the product. Tax is automatically calculated for orders where marketplace facilitator tax laws are applicable. Otherwise, tax settings from Merchant Center are applied.
  *   `targetCountry` (*type:* `String.t`, *default:* `nil`) - Required. The CLDR territory // code of the target country of the product.
  *   `title` (*type:* `String.t`, *default:* `nil`) - Required. The title of the product.
  *   `variantAttributes` (*type:* `list(GoogleApi.Content.V2.Model.OrderLineItemProductVariantAttribute.t)`, *default:* `nil`) - Variant attributes for the item. Optional.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :brand => String.t() | nil,
          :channel => String.t() | nil,
          :condition => String.t() | nil,
          :contentLanguage => String.t() | nil,
          :fees => list(GoogleApi.Content.V2.Model.OrderLineItemProductFee.t()) | nil,
          :gtin => String.t() | nil,
          :imageLink => String.t() | nil,
          :itemGroupId => String.t() | nil,
          :mpn => String.t() | nil,
          :offerId => String.t() | nil,
          :price => GoogleApi.Content.V2.Model.Price.t() | nil,
          :targetCountry => String.t() | nil,
          :title => String.t() | nil,
          :variantAttributes =>
            list(GoogleApi.Content.V2.Model.OrderLineItemProductVariantAttribute.t()) | nil
        }

  field(:brand)
  field(:channel)
  field(:condition)
  field(:contentLanguage)
  field(:fees, as: GoogleApi.Content.V2.Model.OrderLineItemProductFee, type: :list)
  field(:gtin)
  field(:imageLink)
  field(:itemGroupId)
  field(:mpn)
  field(:offerId)
  field(:price, as: GoogleApi.Content.V2.Model.Price)
  field(:targetCountry)
  field(:title)

  field(:variantAttributes,
    as: GoogleApi.Content.V2.Model.OrderLineItemProductVariantAttribute,
    type: :list
  )
end

defimpl Poison.Decoder, for: GoogleApi.Content.V2.Model.TestOrderLineItemProduct do
  def decode(value, options) do
    GoogleApi.Content.V2.Model.TestOrderLineItemProduct.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Content.V2.Model.TestOrderLineItemProduct do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
